#if 0

#include "Timer.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <unistd.h>
#include <sys/timerfd.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <stdint.h>
#include <pthread.h>
#include <iostream>
#include <map>
#include <algorithm>
#include <list>

/**************************************************************************/
// Test
void timer_proc(void *args) {
	time_t timer;
	struct tm *tblock;
	timer = time(NULL);
	tblock = localtime(&timer);
	printf("Local time is: %s  ", asctime(tblock));
	cout << args << endl;
}

class A {
public:
	A(int n) {
		num = n;
	}
public:
	static void show(void *args);
	static void showNum(void *args) {
		printf("Num:%d\n",args);
	}
public:
	 int num;
};

void A::show(void *args)
{	
	A* a = (A*)args;
	a->num++;
	time_t timer;
	struct tm *tblock;
	timer = time(NULL);
	tblock = localtime(&timer);
	printf("Local time is: %s  ", asctime(tblock));
	cout << a->num << endl;

	//delete a;
}

int main() {
	list<Timer*> l;
	A a(10);

	//for (int i = 0; i < 2; ++i) {
	//	Timer *t = new Timer();
		//t->start(5000, timer_proc, reinterpret_cast<void*>(i));
		//t->start(5000, &A::showNum, reinterpret_cast<void*>(i));
		//t->start(5000, &a.showNum, reinterpret_cast<void*>(i));
	//	t->start(1000, &a.show, reinterpret_cast<void*>(&a));
	//	l.push_back(t);
	//	sleep(1);
	//}

	Timer *t1 = new Timer();
	t1->start(1000, &A::show, reinterpret_cast<void*>(&a));
	l.push_back(t1);

	Timer *t2 = new Timer();
	t2->start(1000, &A::show, reinterpret_cast<void*>(&a));
	l.push_back(t2);

	sleep(3);
	getchar();
	return 0;
}

#endif // 1


